package com.minimalist.common.entity.lindi.vo.contracttemplatefield;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.config.mybatis.bo.PageReq;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 林地指标平台_合同模板字段配置查询VO
 *
 * @author 11987
 * @since 2025-05-31
 */

@Schema(name = "林地指标平台_合同模板字段配置查询实体")
public class LindiContractTemplateFieldQueryVO extends PageReq implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "contractTemplateId", description = "合同模板ID", type = "string")
    private Long contractTemplateId;

    @Schema(name = "fieldName", description = "字段名称", type = "string")
    private String fieldName;

    @Schema(name = "fieldType", description = "字段类型", type = "string")
    private String fieldType;

    @Schema(name = "fieldRequire", description = "是否必填", type = "integer")
    private Byte fieldRequire;

    public LindiContractTemplateFieldQueryVO(){
    }

    public Long getContractTemplateId(){
        return contractTemplateId;
    }

    public void setContractTemplateId(Long contractTemplateId){
        this.contractTemplateId = contractTemplateId;
    }

    public String getFieldName(){
        return fieldName;
    }

    public void setFieldName(String fieldName){
        this.fieldName = fieldName;
    }

    public String getFieldType(){
        return fieldType;
    }

    public void setFieldType(String fieldType){
        this.fieldType = fieldType;
    }

    public Byte getFieldRequire(){
        return fieldRequire;
    }

    public void setFieldRequire(Byte fieldRequire){
        this.fieldRequire = fieldRequire;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        if (!super.equals(o)){
            return false;
        }
        LindiContractTemplateFieldQueryVO that = (LindiContractTemplateFieldQueryVO) o;
        return Objects.equals(contractTemplateId, that.contractTemplateId) && Objects.equals(fieldName, that.fieldName) && Objects.equals(fieldType, that.fieldType) && Objects.equals(fieldRequire, that.fieldRequire);
    }

    @Override
    public int hashCode(){
        return Objects.hash(super.hashCode(), contractTemplateId, fieldName, fieldType, fieldRequire);
    }
}
